//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { UserRole, UserRoleResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooUserRoleList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<UserRoleResponse>(`/uctoo/user_role/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooUserRole = async (id: string) => {
  return requestClient.get<UserRole>(`/uctoo/user_role/${id}`);
};

export const adductooUserRole = async (data: Partial<UserRole>) => {
  return requestClient.post<UserRole>('/uctoo/user_role/add', data);
};

export const edituctooUserRole = async (data: Partial<UserRole>) => {
  return requestClient.post<UserRole>('/uctoo/user_role/edit', data);
};

export const deleteuctooUserRole = async (id: string) => {
  return requestClient.post<any>('/uctoo/user_role/del', { id });
};
